<template>
  <div class="com">
    <div class="img">
      <el-image class="full" :src="row.imgId" fit="cover">
        <el-image class="full" slot="error" fit="cover" :src="require('@/assets/images/no.png')" />
      </el-image>
      <img class="img-icon" v-if="row.houSubType === '1'" src="@/assets/images/icons/fullView2.png" />
    </div>
    <div class="pl20 pdh10 d-flex fd-column jc-around">
      <div class="bold fs-l">{{ row.resblockName }}</div>
      <div>
        <span>{{ row.room }}室</span>
        <span>{{ row.hall }}厅</span>
        <span class="mw20">|</span>
        <span>{{ row.buildSize }}㎡</span>
        <span class="mw20">|</span>
        <span class="text-red" v-if="row.delegationType === 'SALES'"
          >{{ row.totalPrices ? row.totalPrices / 10000 : 0 }}万</span
        >
        <span class="text-red" v-else>{{ row.totalPrices || 0 }}元/月</span>
      </div>
      <div>添加时间：{{ row.delCreateTime | dateFormat | empty }}</div>
    </div>
    <div class="fr pr20">
      <div class="d-flex fd-column jc-center">
        <template v-if="row.houSubType === '1'">
          <el-button class="pedding-btn text-red" v-if="row.houSubTypeState === '1'" type="text" :loading="true">
            全景抓取中，请耐心等待
          </el-button>
          <div v-if="row.houSubTypeState === '10'">
            <el-button type="primary" round size="mini" @click="handleTakePhoto">预览拍照</el-button>
          </div>
          <div class="text-red" v-if="row.houSubTypeState === '-1'">下载失败</div>
        </template>
        <template v-else>
          <div class="text-red">该房源暂无vr全景</div>
        </template>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'RemarkVrListItem',

  components: {},

  props: {
    row: {
      type: Object,
      default() {
        return {};
      }
    }
  },

  data() {
    return {};
  },

  computed: {},

  watch: {},

  beforeMount() {},

  mounted() {},

  methods: {
    handleTakePhoto() {
      const { delId } = this.row;
      this.$emit('takephoto', delId);
    }
  }
};
</script>
<style lang="scss" scoped>
@import '~@/styles/colors.scss';
.com {
  display: flex;
  height: 100px;
  background-color: $lightest-blue;
}

.img {
  position: relative;
  width: 140px;
  height: 100px;

  .img-icon {
    position: absolute;
    bottom: 6px;
    left: 6px;
    width: 30px;
    height: 30px;
  }
}

.pedding-btn::before {
  background-color: transparent;
}
</style>
